package day07;

import java.util.Scanner;

public class CaLAirPrice {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入机票原价");
        double prince= scan.nextDouble();
        System.out.println("请输入月份");
        int mun= scan.nextInt();
        System.out.println("请选择仓位");
        int type=scan.nextInt();
        double Finalprice=finalPrice(1000,4,1);


    }
    public static double finalPrice(double price,int mun,int type){
        double finalprice=0.0;
        if(finalprice!=-1){
            System.out.println("机票最终价格为"+finalprice);
        }
        if(mun<1 ||mun>12){
            System.out.println("输入错误");
            return -1;
        }
        if(type>3 ||type<1){
            System.out.println("输入错误");
            return -1;
        }
        if(price<=0){
            System.out.println("输入·1错误");
            return -1;
        }
        if(mun<=5&& mun>=10){
            switch (type){
                case 1:
                    finalprice=price*0.9;
                    break;
                case 2:
                    finalprice=price*0.85;
                    break;
                case 3:
                    finalprice=price*0.8;
                    break;
            }
        } else{
            switch (type){
                case 1:
                    finalprice=price*7;
                    break;
                case 2:
                    finalprice=price*0.65;
                    break;
                case 3:
                    finalprice=price*0.6;
                    break;
            }

        }

        return finalprice;

    }
}
